<%@ page language="java" contentType="text/html; charset=utf-8" errorPage="/404.jsp" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>房屋信息管理-房屋详情</title>
    <style type="text/css">
        @import url("<c:url value='/css/main.css'/>");
    </style>
</head>


<body>
<div class="div_main">
    <div class="div_header">房屋信息管理-房屋详情</div>
    <h1 align="center">
        <a href="${pageContext.request.contextPath}/house/list.action">
            返回首页
        </a>
    </h1>
    <c:if test="${not empty house}">
        <div class="div_data">
            <table class="tab_list">
                <tr>
                    <th>序号</th>
                    <th>地区</th>
                    <th>小区</th>
                    <th>单元</th>
                    <th>楼层</th>
                    <th>房号</th>
                    <th>面积</th>
                    <th>朝向</th>
                    <th>装修</th>
                    <th>是否有双气</th>
                    <th>限住人数</th>
                    <th>配套设施</th>
                    <th>日租</th>
                    <th>房屋状态</th>
                    <th>房屋图片</th>
                    <th>地址</th>
                    <th>添加时间</th>
                    <th>信息修改时间</th>
                    <th>操作</th>
                </tr>
                <tr>
                    <td>${house.hid}</td>
                    <td>${house.harea}</td>
                    <td>${house.hcommunity}</td>
                    <td>${house.hunitnumber}</td>
                    <td>${house.hfloor}</td>
                    <td>${house.hroomno}</td>
                    <td>${house.hacreage}</td>
                    <td>${house.hdirectionStr}</td>
                    <td>${house.hfitmentStr}</td>
                    <td>${house.hisdoubleairStr}</td>
                    <td>${house.hlimit}</td>
                    <td>${house.hfacility}</td>
                    <td>${house.hprice}</td>
                    <td>${house.hstatusStr}</td>

                    <td>
                        <img src="${pageContext.request.contextPath}/image/${house.himg}" alt="${house.himg}"
                             width="20px" height="20px">
                    </td>
                    <td>${house.haddress}</td>
                    <td>${house.haddtimeStr}</td>
                    <td>${house.hupdatetimeStr}</td>

                    <td>
                        &nbsp;&nbsp;
<%--                        <a href="${pageContext.request.contextPath}/view/house/update.jsp">编辑</a>--%>
                        <a href="${pageContext.request.contextPath}/house/getOneByHid.action?hid=${house.hid}&method=update">编辑</a>
                        &nbsp;&nbsp;
                        <a href="#" onclick="confirmDelete(${house.hid})">删除</a>

                        <script>
                            function confirmDelete(id) {
                                if (confirm("确定要删除码？")) {
                                    window.location="${pageContext.request.contextPath}/house/deleteOneByHid.action?hid=" + id;
                                    // 重定向
                                }
                                return false;
                            }
                        </script>
                    </td>
                </tr>

            </table>
        </div>
    </c:if>


</div>
</body>
</html>

